home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16956 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  49 lines

  1. Newsgroups: comp.lang.c++
  2. Path: dmocc2.on.bell.ca!bc2cep!news
  3. From: Eric Marc Loebenberg <loebenbe@qc.bell.ca>
  4. Subject: Help? Confusion with CFileDialog and default file extensions
  5. X-Nntp-Posting-Host: cmocft.qc.bell.ca
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <316EC9EE.6BDB@qc.bell.ca>
  8. Sender: news@on.bell.ca (news admin)
  9. Content-Transfer-Encoding: 7bit
  10. Cc: loebenbe@post.sygma.net
  11. Organization: Bell Sygma
  12. Mime-Version: 1.0
  13. Date: Fri, 12 Apr 1996 21:23:58 GMT
  14. X-Mailer: Mozilla 2.0 (Win95; I)
  15.  
  16. Can anyone clear this up for me?
  17.  
  18. When using Windows 3.11, MSVC++ 1.52, the CFileDialog worked in a way I
  19. understood.  Let's say I construct a dialog like this:  
  20.  
  21. CFileDialog dlg(TRUE,"mtr","*.mtr", OFN_HIDEREADONLY, Message);
  22.  
  23. "*.mtr" appears initially in the file name field and if the users
  24. avoids putting on an extension, CFileDialog adds .mtr as indicated in 
  25. the second argument.
  26.  
  27. This works well.
  28.  
  29. Now I move to Windows 95 and MSVC++ Version 4.0 and the latest MFC.
  30.  
  31. When I do the same thing, CFileDialog behaves differently.
  32.  
  33. If the user simply types FRED, CFileDialog returns FRED.MTR
  34. but if the user types fred.mtp  ===> OUCH, CFileDialog returns
  35. fred.mtp.mtp, thus always adds .MTP no matter what the users types.
  36.  
  37. I want this added within the framework of CFileDialog because there
  38. are several checks (e.g. file existence) that occur.
  39.  
  40. Is there a way to make this dialog behave more like the MFC 2.5 version
  41. where .mtr is added only if no extension is used?
  42.  
  43. Thanks.  I tried to play with the new OFN_NOLONGNAMES and this is unrelated
  44. to my problem.
  45.  
  46. Eric Marc Loebenberg
  47. Bell Sygma Inc.
  48. Montreal, Quebec , Canada.
  49.